package com.wangmei.service.serviceimpl;

import com.wangmei.mapper.AddressMapper;
import com.wangmei.model.Address;
import com.wangmei.pojo.AddressAndUser;
import com.wangmei.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class AddressServiceImpl implements AddressService {
    @Autowired
    private AddressMapper addressMapper;

    public List<AddressAndUser> queryAll(Map<String,Object> param){
        return addressMapper.queryAllAddress(param);
    }
    public int inserAddr(Address record){
        return addressMapper.insertSelective(record);
    }
    public int deleteAddr(int key){
        return addressMapper.deleteByPrimaryKey(key);
    }
    public int updateAddr(Address record){
        return addressMapper.updateByPrimaryKeySelective(record);
    }
}
